package top.fzqblog.ranges


/**
 * Created by 抽离 on 2017/8/3 0003.
 */

fun main(args: Array<String>) {
    val a = 10

    if(a in 1..10){
        println("a：" + a)
    }

    if(a !in 1..8){
        println("a：" + a)
    }

    for (i in 4 downTo 1) println(i)

    println("\n有点华丽的分割线：" + "------------------")

    for (i in 4..1) println(i) // prints nothing
    println("\n有点华丽的分割线：" + "------------------")

    for (x in 1..2) print("$x ") // prints "1.0 2.0 "
    println("\n有点华丽的分割线：" + "------------------")

    for (i in 1..4 step 2) print(i) // prints "13"
    println("\n有点华丽的分割线：" + "------------------")

    for (i in 4 downTo 1 step 2) print(i) // prints "42"
}


